﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ZhangZhao.WebAPI
{
    public partial class UserRelationshipEdit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string s = Output.Fail;

            try
            {
                string UserName = HttpContext.Current.Request[Parameter.UserName];
                string OtherUserName = HttpContext.Current.Request[Parameter.OtherUserName];
                string RelationShip = HttpContext.Current.Request[Parameter.RelationShip];
                
                if (!string.IsNullOrWhiteSpace(UserName) && !string.IsNullOrWhiteSpace(OtherUserName) && !string.IsNullOrWhiteSpace(RelationShip))
                {
                    ZhangZhao.BLL.H_UserRelationship bll = new BLL.H_UserRelationship();
                    bll.Add(new ZhangZhao.Model.H_UserRelationship()
                    {
                        CreatedTime = DateTime.Now,
                        OtherUserName = OtherUserName,
                        RelationShip = RelationShip,
                        UserName = UserName
                    });

                    s = ZhangZhao.WebAPI.Output.Success;
                }
            }
            catch (Exception ex)
            {
                s = Output.Exception + ":" + ex.Message;
            }

            Response.Clear();
            Response.Write(s);
            Response.End();
        }
    }
}